package com.starlink.model.util;

import com.starlink.model.dtomapper.MallBooksDetailDtoMapper;
import com.starlink.model.domain.MallBooksDetailDO;
import com.starlink.model.vo.MallBooksDetailVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallBooksDetailConvert {

    public static List<MallBooksDetailVO> buildMallBooksDetailVoList(List<MallBooksDetailDO> mallBooksDetailDOList) {
        if (CollectionUtils.isEmpty(mallBooksDetailDOList)) {
            return Lists.newArrayList();
        }
        List<MallBooksDetailVO> mallBooksDetailVOList = new ArrayList<>();
        for (MallBooksDetailDO mallBooksDetailDO : mallBooksDetailDOList) {
            mallBooksDetailVOList.add(MallBooksDetailDtoMapper.INSTANCE.do2VO(mallBooksDetailDO));
        }

        return mallBooksDetailVOList;
    }
}
